- avatar = local_assigns[:avatar].nil? || local_assigns[:avatar]
- stars = local_assigns[:stars].nil? || local_assigns[:stars]
- forks = local_assigns[:forks].nil? || local_assigns[:forks]
- merge_requests = local_assigns[:merge_requests].nil? || local_assigns[:merge_requests]
- issues = local_assigns[:issues].nil? || local_assigns[:issues]
- pipeline_status = local_assigns[:pipeline_status].nil? || local_assigns[:pipeline_status]
- skip_namespace = local_assigns[:skip_namespace]
- compact_mode = local_assigns[:compact_mode]
- use_creator_avatar = local_assigns[:use_creator_avatar]
- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && can_show_last_commit_in_list?(project)
- access = max_project_member_access(project)
- css_class = "@sm/panel:gl-flex gl-items-center !gl-align-middle" if project.description.blank? && !show_last_commit_as_description
- updated_tooltip = time_ago_with_tooltip(project.last_activity_at || project.updated_at)
- show_pipeline_status_icon = pipeline_status && can?(current_user, :read_cross_project) && project.pipeline_status.has_status? && can?(current_user, :read_build, project)
- last_pipeline = last_pipeline_from_status_cache(project) if show_pipeline_status_icon
- css_controls_class = "with-pipeline-status" if show_pipeline_status_icon && last_pipeline.present?
- css_metadata_classes = "gl-flex gl-items-center !gl-text-inherit icon-wrapper has-tooltip"
- project_avatar_link_label = _("View %{project} project") % { project: project.name }

%li.project-row
  - if avatar
    .project-cell.gl-w-11
      = link_to project_path(project), class: dom_class(project) do
        %span.gl-sr-only
          = project_avatar_link_label
        - if project.creator && use_creator_avatar
          = render Pajamas::AvatarComponent.new(project.creator, size: 48, alt: '', avatar_options: { aria: { hidden: "true" } })
        - else
          = render Pajamas::AvatarComponent.new(project, size: 48, alt: '', avatar_options: { aria: { hidden: "true" } })

  .project-cell{ class: css_class }
    .project-details.gl-pr-9.gl-sm-pr-0.gl-w-full.gl-flex.gl-flex-col{ data: { testid: 'project-content', qa_project_name: project.name } }
      .gl-flex.gl-items-baseline.gl-flex-wrap
        %h2.gl-text-base.gl-leading-20.gl-my-0.gl-wrap-anywhere
          = link_to project_path(project), class: 'gl-text-default hover:gl-text-default gl-mr-3 js-prefetch-document', title: project.name do
            %span.namespace-name.gl-font-normal
              - if project.namespace && !skip_namespace
                = project.namespace.human_name
                \/
            %span.project-name<
              - if @search_term.present?
                = simple_search_highlight_and_truncate(project.name, @search_term)
              - else
                = project.name

        = visibility_level_content(project, css_class: 'gl-mr-2', icon_css_class: 'gl-fill-icon-subtle')

        - if project.catalog_resource
          = render partial: 'shared/ci_catalog_badge', locals: { href: explore_catalog_path(project.catalog_resource), css_class: 'gl-self-center gl-mr-2', is_published: project.catalog_resource.published? }

        - if explore_projects_tab? && project_license_name(project)
          %span.gl-inline-flex.gl-items-center.gl-mr-3
            = sprite_icon('scale', size: 14, css_class: 'gl-mr-2')
            = project_license_name(project)

        - if !explore_projects_tab? && access&.nonzero?
          -# haml-lint:disable UnnecessaryStringOutput
          = ' ' # prevent haml from eating the space between elements
          = render Pajamas::BadgeComponent.new(localized_project_human_access(access), variant: 'neutral', data: { testid: 'user-access-role' })

        - if !explore_projects_tab?
          = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: project, additional_classes: '!gl-ml-2'

      - if show_last_commit_as_description
        .description.gl-hidden.gl-overflow-hidden.gl-mr-3.gl-mt-2.gl-text-sm{ class: "@sm/panel:gl-block" }
          = link_to_markdown(project.commit.title, project_commit_path(project, project.commit), class: "commit-row-message")
      - elsif project.description.present?
        .description.gl-hidden.gl-overflow-hidden.gl-mr-3.gl-mt-2.gl-text-sm{ class: "@sm/panel:gl-block" }
          = markdown_field(project, :description)

      - if project.topics.any?
        .gl-mt-2
          = render "shared/projects/topics", project: project.present(current_user: current_user)

      = render 'shared/projects/removed', project: project

      .gl-flex.gl-items-center.gl-mt-3{ class: "#{css_class} @sm/panel:!gl-hidden" }
        .controls.gl-flex.gl-items-center
          - if show_pipeline_status_icon && last_pipeline.present?
            - pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
            %span.icon-wrapper.pipeline-status
              = render 'ci/status/icon', status: last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path

          = render 'shared/projects/badges', project: project
          - if stars
            = link_to project_starrers_path(project), class: "#{css_metadata_classes} stars", title: _('Stars'), data: { container: 'body', placement: 'top' } do
              = sprite_icon('star-o', size: 14, css_class: 'gl-mr-2')
              = badge_count(project.star_count)
        .updated-note.gl-text-sm.gl-ml-3.gl-sm-ml-0
          %span
            = _('Updated')
            = updated_tooltip
        = render_if_exists 'shared/projects/actions', project: project

  .project-cell.project-controls.gl-text-subtle{ class: "#{css_class} !gl-hidden @sm/panel:!gl-table-cell", data: { testid: 'project_controls'} }
    .controls.gl-flex.gl-items-center.gl-mb-2.gl-gap-4{ class: "#{css_controls_class} !gl-pr-0 !gl-justify-end" }
      - if show_pipeline_status_icon && last_pipeline.present?
        - pipeline_path = pipelines_project_commit_path(project.pipeline_status.project, project.pipeline_status.sha, ref: project.pipeline_status.ref)
        %span.icon-wrapper.pipeline-status
          = render 'ci/status/icon', status: last_pipeline.detailed_status(current_user), tooltip_placement: 'top', path: pipeline_path

      = render 'shared/projects/badges', project: project
      - if stars
        = link_to project_starrers_path(project), class: "#{css_metadata_classes} stars", title: _('Stars'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} star', '%{project} has %{number} stars', project.star_count), number: project.star_count, project: project.name) } do
          = sprite_icon('star-o', size: 14, css_class: 'gl-mr-2')
          = badge_count(project.star_count)
      - if show_count?(disabled: !forks, compact_mode: compact_mode)
        = link_to project_forks_path(project), class: "#{css_metadata_classes} forks", title: _('Forks'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} fork', '%{project} has %{number} forks', project.forks_count), number: project.forks_count, project: project.name) } do
          = sprite_icon('fork', size: 14, css_class: 'gl-mr-2')
          = badge_count(project.forks_count)
      - if show_count?(disabled: !merge_requests, compact_mode: compact_mode)
        = link_to project_merge_requests_path(project), class: "#{css_metadata_classes} merge-requests", title: _('Merge requests'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} open merge request', '%{project} has %{number} open merge requests', project.open_merge_requests_count), number: project.open_merge_requests_count, project: project.name) } do
          = sprite_icon('merge-request', size: 14, css_class: 'gl-mr-2')
          = badge_count(project.open_merge_requests_count)
      - if show_count?(disabled: !issues, compact_mode: compact_mode)
        = link_to project_issues_path(project), class: "#{css_metadata_classes} issues", title: _('Issues'), data: { container: 'body', placement: 'top' }, aria: { label: format(n_('%{project} has %{number} open issue', '%{project} has %{number} open issues', project.open_issues_count), number: project.open_issues_count, project: project.name) } do
          = sprite_icon('work-item-issue', size: 14, css_class: 'gl-mr-2')
          = badge_count(project.open_issues_count)
      = render_if_exists 'shared/projects/actions', project: project
    .updated-note.gl-text-sm.gl-whitespace-nowrap.gl-justify-end
      %span
        = _('Updated')
        = updated_tooltip
